home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / tbbs / flog310.zip / IEMSI.H < prev    next >
C/C++ Source or Header  |  1996-04-19  |  2KB  |  68 lines

  1. /*
  2.         FastLog/IEMSI Interface code for adding IEMSI support to programs
  3.         external to FastLog/IEMSI v2.31.
  4.  
  5.         Written:  28/10/95
  6.         Updated:  16/01/96
  7.         Released: 16/01/96
  8.  
  9.         Author:   Faye Pearson
  10.  
  11.         (C) 1995,1996 Fe-line Software
  12. */
  13.  
  14. char IEMSI_HSK[2049]; // Holds the IEMSI Handshake.
  15.  
  16. typedef struct
  17. {
  18. char *name,           // pointer to the Users Name as given in the IEMSI h/shake
  19.         *alias,      
  20.     *location,
  21.     *data,
  22.     *voice,
  23.     *password,
  24.     *birthdate,
  25.         *crtdef,       // pointer to comma delimited info about users Terminal
  26.         *protocols,    // pointer to comma delimited list of protocols
  27.         *capabilities, // pointer to comma delimited list of package capabilities
  28.         *requests,     // pointer to comma delimited list of user requests
  29.         *software,     // The software sending the IEMSI Handshake
  30.         *xlattabl;     // No definition as yet in IEMSI
  31. } IEMSI_PKT;
  32.  
  33. IEMSI_PKT IEMSI_ICI;   // Use this to access the fields in the IEMSI packet
  34.  
  35. #define IEMSI_NOTINST 0      // FastLog/IEMSI Not Installed
  36. #define IEMSI_NOTUSED 1      // Current User not using IEMSI
  37. #define IEMSI_AVAILABLE 2    // User logged in with IEMSI
  38.  
  39. int getiemsi()
  40. {
  41.     FILE *fp;
  42.     char *tok;
  43.  
  44.     if((fp=fopen("IEMSI.HSK","rt"))==NULL)
  45.     {
  46.         Log(LOG_FRIEND,"IEMSI.HSK not found IEMSI not available");
  47.         return IEMSI_NOTINST;
  48.     }
  49.         fgets(IEMSI_HSK,2049,fp);
  50.     fclose(fp);
  51.     if(strcmp(chk,"NOIEMSI")==0) return IEMSI_NOTUSED;
  52.         tok=strchr(chk,'{')+1;               // Separate the IEMSI Fields.
  53.         IEMSI_ICI.name=strtok(tok,"}");
  54.         IEMSI_ICI.alias=strtok(NULL,"}")+1;
  55.         IEMSI_ICI.location=strtok(NULL,"}")+1;
  56.         IEMSI_ICI.data=strtok(NULL,"}")+1;
  57.         IEMSI_ICI.voice=strtok(NULL,"}")+1;
  58.         IEMSI_ICI.password=strtok(NULL,"}")+1;
  59.         IEMSI_ICI.birthdate=strtok(NULL,"}")+1;
  60.         IEMSI_ICI.crtdef=strtok(NULL,"}")+1;
  61.         IEMSI_ICI.protocols=strtok(NULL,"}")+1;
  62.         IEMSI_ICI.capabilities=strtok(NULL,"}")+1;
  63.         IEMSI_ICI.requests=strtok(NULL,"}")+1;
  64.         IEMSI_ICI.software=strtok(NULL,"}")+1;
  65.         IEMSI_ICI.xlattabl=strtok(NULL,"}")+1;
  66.     return IEMSI_AVAILABLE;
  67. }
  68.